	
	<div id="page-content">
			<div class="col-lg-12">
		        <div class="panel">
		            <div class="panel-heading">
		                <h3 class="panel-title" style="text-align: right;">
		                	#@installPJaxGoBackBtn()
		                	添加
		                </h3>
		            </div>
		            <form id="editForm" class="panel-body form-horizontal form-padding">
						<input type="hidden"  name="#(formModelName).id" class="form-control" value="#(o?o.id:'')">
			                <div class="form-group">
			                    <label class="col-md-2 control-label">主键</label>
			                    <div class="col-md-9">
			                        <input type="text"  name="#(formModelName).id" class="form-control"  value="#(o?o.id:'')" #if(view=='detail') readonly #end>
			                        <small class="help-block">请输入主键</small>
			                    </div>
			                </div>
			                <div class="form-group">
			                    <label class="col-md-2 control-label">标题</label>
			                    <div class="col-md-9">
			                        <input type="text"  name="#(formModelName).title" class="form-control"  value="#(o?o.title:'')" #if(view=='detail') readonly #end>
			                        <small class="help-block">请输入标题</small>
			                    </div>
			                </div>
			                <div class="form-group">
			                    <label class="col-md-2 control-label">和同名</label>
			                    <div class="col-md-9">
			                        <input type="text"  name="#(formModelName).name" class="form-control"  value="#(o?o.name:'')" #if(view=='detail') readonly #end>
			                        <small class="help-block">请输入和同名</small>
			                    </div>
			                </div>
			                <div class="form-group">
			                    <label class="col-md-2 control-label">客户名称</label>
			                    <div class="col-md-9">
			                        <input type="text"  name="#(formModelName).custom_name" class="form-control"  value="#(o?o.custom_name:'')" #if(view=='detail') readonly #end>
			                        <small class="help-block">请输入客户名称</small>
			                    </div>
			                </div>
			                <div class="form-group">
			                    <label class="col-md-2 control-label">客户联系人</label>
			                    <div class="col-md-9">
			                        <input type="text"  name="#(formModelName).custom_contact_person" class="form-control"  value="#(o?o.custom_contact_person:'')" #if(view=='detail') readonly #end>
			                        <small class="help-block">请输入客户联系人</small>
			                    </div>
			                </div>
			                <div class="form-group">
			                    <label class="col-md-2 control-label">客户手机号</label>
			                    <div class="col-md-9">
			                        <input type="text"  name="#(formModelName).custom_contact_mobile" class="form-control"  value="#(o?o.custom_contact_mobile:'')" #if(view=='detail') readonly #end>
			                        <small class="help-block">请输入客户手机号</small>
			                    </div>
			                </div>
			                <div class="form-group">
			                    <label class="col-md-2 control-label">合同类型
1：买卖、2：租赁、3：供用电/水/气、4：融资租赁合同、5：技术合同、6：运输合同及建设工程合同</label>
			                    <div class="col-md-9">
			                        <input type="text"  name="#(formModelName).type" class="form-control"  value="#(o?o.type:'')" #if(view=='detail') readonly #end>
			                        <small class="help-block">请输入合同类型
1：买卖、2：租赁、3：供用电/水/气、4：融资租赁合同、5：技术合同、6：运输合同及建设工程合同</small>
			                    </div>
			                </div>
			                <div class="form-group">
			                    <label class="col-md-2 control-label">合同金额</label>
			                    <div class="col-md-9">
			                        <input type="text"  name="#(formModelName).amount_of_money" class="form-control"  value="#(o?o.amount_of_money:'')" #if(view=='detail') readonly #end>
			                        <small class="help-block">请输入合同金额</small>
			                    </div>
			                </div>
			                <div class="form-group">
			                    <label class="col-md-2 control-label">合同明细</label>
			                    <div class="col-md-9">
			                        <input type="text"  name="#(formModelName).detail" class="form-control"  value="#(o?o.detail:'')" #if(view=='detail') readonly #end>
			                        <small class="help-block">请输入合同明细</small>
			                    </div>
			                </div>
			                <div class="form-group">
			                    <label class="col-md-2 control-label">合同背景说明</label>
			                    <div class="col-md-9">
			                        <input type="text"  name="#(formModelName).background" class="form-control"  value="#(o?o.background:'')" #if(view=='detail') readonly #end>
			                        <small class="help-block">请输入合同背景说明</small>
			                    </div>
			                </div>
			                <div class="form-group">
			                    <label class="col-md-2 control-label">合同需求说明</label>
			                    <div class="col-md-9">
			                        <input type="text"  name="#(formModelName).need" class="form-control"  value="#(o?o.need:'')" #if(view=='detail') readonly #end>
			                        <small class="help-block">请输入合同需求说明</small>
			                    </div>
			                </div>
			                <div class="form-group">
			                    <label class="col-md-2 control-label">合同内部合作说明</label>
			                    <div class="col-md-9">
			                        <input type="text"  name="#(formModelName).work_together" class="form-control"  value="#(o?o.work_together:'')" #if(view=='detail') readonly #end>
			                        <small class="help-block">请输入合同内部合作说明</small>
			                    </div>
			                </div>
			                <div class="form-group">
			                    <label class="col-md-2 control-label"> 补充说明</label>
			                    <div class="col-md-9">
			                        <input type="text"  name="#(formModelName).add_ext" class="form-control"  value="#(o?o.add_ext:'')" #if(view=='detail') readonly #end>
			                        <small class="help-block">请输入 补充说明</small>
			                    </div>
			                </div>
			                <div class="form-group">
			                    <label class="col-md-2 control-label"> 产品与需求的偏差风险</label>
			                    <div class="col-md-9">
			                        <input type="text"  name="#(formModelName).danger_need" class="form-control"  value="#(o?o.danger_need:'')" #if(view=='detail') readonly #end>
			                        <small class="help-block">请输入 产品与需求的偏差风险</small>
			                    </div>
			                </div>
			                <div class="form-group">
			                    <label class="col-md-2 control-label">需求不明确的风险</label>
			                    <div class="col-md-9">
			                        <input type="text"  name="#(formModelName).danger_need_no_ok" class="form-control"  value="#(o?o.danger_need_no_ok:'')" #if(view=='detail') readonly #end>
			                        <small class="help-block">请输入需求不明确的风险</small>
			                    </div>
			                </div>
			                <div class="form-group">
			                    <label class="col-md-2 control-label"> 付款条件苛刻，回款难度大的风险</label>
			                    <div class="col-md-9">
			                        <input type="text"  name="#(formModelName).danger_pay_hard" class="form-control"  value="#(o?o.danger_pay_hard:'')" #if(view=='detail') readonly #end>
			                        <small class="help-block">请输入 付款条件苛刻，回款难度大的风险</small>
			                    </div>
			                </div>
			                <div class="form-group">
			                    <label class="col-md-2 control-label">合同法律违约条款的风险</label>
			                    <div class="col-md-9">
			                        <input type="text"  name="#(formModelName).danger_law" class="form-control"  value="#(o?o.danger_law:'')" #if(view=='detail') readonly #end>
			                        <small class="help-block">请输入合同法律违约条款的风险</small>
			                    </div>
			                </div>
			                <div class="form-group">
			                    <label class="col-md-2 control-label">其他方面的风险阐述</label>
			                    <div class="col-md-9">
			                        <input type="text"  name="#(formModelName).danger_ext" class="form-control"  value="#(o?o.danger_ext:'')" #if(view=='detail') readonly #end>
			                        <small class="help-block">请输入其他方面的风险阐述</small>
			                    </div>
			                </div>
			                <div class="form-group">
			                    <label class="col-md-2 control-label">合同状态.1:默认正常。2：终止.3:完结</label>
			                    <div class="col-md-9">
			                        <input type="text"  name="#(formModelName).state" class="form-control"  value="#(o?o.state:'')" #if(view=='detail') readonly #end>
			                        <small class="help-block">请输入合同状态.1:默认正常。2：终止.3:完结</small>
			                    </div>
			                </div>
		                	#if(view=='detail')
			                
				            #else
			            	<div class="panel-footer">
			                    <div class="row">
			                        <div class="col-sm-8 col-sm-offset-3">
			                            <button class="btn btn-warning" type="reset" #if(view=='detail') disabled #end>重置</button>
			                            <button class="btn btn-primary" type="submit" #if(view=='detail') disabled #end>保存</button>
			                        </div>
			                    </div>
			                </div>
				            #end
		            </form>
		        </div>
		    </div>
	</div>
	<script>
		function save(){
			var data = common_ajax.ajaxFunc("/admin/contract/save", $('#editForm').serialize(), "json", null);
			if(data.success){
				pointLion.alertMsg("保存成功!" , "success" , "small" , function(){
					location.href = ctx+'/admin/contract/getListPage';//跳转到列表页
				});
			}else{
				pointLion.alertMsg(data.message , "success" , "small" , function(){
					$(".btn").removeAttr("disabled");
				});
			}
		}
		$(document).ready(function() {
			$('#editForm').bootstrapValidator({
	            fields: {
	            }
	        }).on("success.form.bv", function (e) {
	            save();
	            return false;//阻止表单跳转
	        });
		});
	</script>